package com.hzlx.reports.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

/**
 * 不合格品报告（NCR）管理（记录从发现到关闭的全过程）对象 mes_non_conforming_reports
 * 
 * @author ruoyi
 * @date 2025-07-01
 */
public class NonConformingReports extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 不合格品报告唯一标识符 */
    private String ncrId;

    /** 问题发现时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "问题发现时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date discoveryTime;

    /** 问题来源（IQC/IPQC/FQC/客户投诉等） */
    @Excel(name = "问题来源", readConverterExp = "I=QC/IPQC/FQC/客户投诉等")
    private String sourceType;

    /** 来源关联ID（检验任务ID/工单ID/订单ID等） */
    @Excel(name = "来源关联ID", readConverterExp = "检=验任务ID/工单ID/订单ID等")
    private String sourceId;

    /** 关联产品ID（如涉及成品） */
    @Excel(name = "关联产品ID", readConverterExp = "如=涉及成品")
    private String productId;

    /** 关联物料ID（如涉及原材料） */
    @Excel(name = "关联物料ID", readConverterExp = "如=涉及原材料")
    private String materialId;


    /** 计量单位 */
    @Excel(name = "计量单位")
    private String unitOfMeasure;

    /** 主要缺陷类型ID */
    @Excel(name = "主要缺陷类型ID")
    private String defectTypeId;

    /** 问题详细描述 */
    @Excel(name = "问题详细描述")
    private String problemDescription;

    /** 初步原因分析 */
    @Excel(name = "初步原因分析")
    private String initialAnalysis;

    /** 处置建议（返工/报废/降级/让步接收/退货） */
    @Excel(name = "处置建议", readConverterExp = "返=工/报废/降级/让步接收/退货")
    private String dispositionProposal;

    /** 处置方案细节 */
    @Excel(name = "处置方案细节")
    private String dispositionDetails;

    /** 处置方案批准人ID */
    @Excel(name = "处置方案批准人ID")
    private String dispositionApprovedBy;

    /** 处置方案批准时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "处置方案批准时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date dispositionApprovalTime;

    /** 实际执行处置 */
    @Excel(name = "实际执行处置")
    private String actualDisposition;

    /** 报告状态（待处理/审核中/处置中/已关闭） */
    @Excel(name = "报告状态", readConverterExp = "待=处理/审核中/处置中/已关闭")
    private String ncrStatus;

    /** 报告创建人ID */
    @Excel(name = "报告创建人ID")
    private String createdBy;

    /** 报告创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "报告创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /** 最后更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedAt;

    public void setNcrId(String ncrId) 
    {
        this.ncrId = ncrId;
    }

    public String getNcrId() 
    {
        return ncrId;
    }

    public void setDiscoveryTime(Date discoveryTime) 
    {
        this.discoveryTime = discoveryTime;
    }

    public Date getDiscoveryTime() 
    {
        return discoveryTime;
    }

    public void setSourceType(String sourceType) 
    {
        this.sourceType = sourceType;
    }

    public String getSourceType() 
    {
        return sourceType;
    }

    public void setSourceId(String sourceId) 
    {
        this.sourceId = sourceId;
    }

    public String getSourceId() 
    {
        return sourceId;
    }

    public void setProductId(String productId) 
    {
        this.productId = productId;
    }

    public String getProductId() 
    {
        return productId;
    }

    public void setMaterialId(String materialId) 
    {
        this.materialId = materialId;
    }

    public String getMaterialId() 
    {
        return materialId;
    }


    public void setUnitOfMeasure(String unitOfMeasure) 
    {
        this.unitOfMeasure = unitOfMeasure;
    }

    public String getUnitOfMeasure() 
    {
        return unitOfMeasure;
    }

    public void setDefectTypeId(String defectTypeId) 
    {
        this.defectTypeId = defectTypeId;
    }

    public String getDefectTypeId() 
    {
        return defectTypeId;
    }

    public void setProblemDescription(String problemDescription) 
    {
        this.problemDescription = problemDescription;
    }

    public String getProblemDescription() 
    {
        return problemDescription;
    }

    public void setInitialAnalysis(String initialAnalysis) 
    {
        this.initialAnalysis = initialAnalysis;
    }

    public String getInitialAnalysis() 
    {
        return initialAnalysis;
    }

    public void setDispositionProposal(String dispositionProposal) 
    {
        this.dispositionProposal = dispositionProposal;
    }

    public String getDispositionProposal() 
    {
        return dispositionProposal;
    }

    public void setDispositionDetails(String dispositionDetails) 
    {
        this.dispositionDetails = dispositionDetails;
    }

    public String getDispositionDetails() 
    {
        return dispositionDetails;
    }

    public void setDispositionApprovedBy(String dispositionApprovedBy) 
    {
        this.dispositionApprovedBy = dispositionApprovedBy;
    }

    public String getDispositionApprovedBy() 
    {
        return dispositionApprovedBy;
    }

    public void setDispositionApprovalTime(Date dispositionApprovalTime) 
    {
        this.dispositionApprovalTime = dispositionApprovalTime;
    }

    public Date getDispositionApprovalTime() 
    {
        return dispositionApprovalTime;
    }

    public void setActualDisposition(String actualDisposition) 
    {
        this.actualDisposition = actualDisposition;
    }

    public String getActualDisposition() 
    {
        return actualDisposition;
    }

    public void setNcrStatus(String ncrStatus) 
    {
        this.ncrStatus = ncrStatus;
    }

    public String getNcrStatus() 
    {
        return ncrStatus;
    }

    public void setCreatedBy(String createdBy) 
    {
        this.createdBy = createdBy;
    }

    public String getCreatedBy() 
    {
        return createdBy;
    }

    public void setCreatedAt(Date createdAt) 
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() 
    {
        return createdAt;
    }

    public void setUpdatedAt(Date updatedAt) 
    {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt() 
    {
        return updatedAt;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("ncrId", getNcrId())
            .append("discoveryTime", getDiscoveryTime())
            .append("sourceType", getSourceType())
            .append("sourceId", getSourceId())
            .append("productId", getProductId())
            .append("materialId", getMaterialId())
            .append("unitOfMeasure", getUnitOfMeasure())
            .append("defectTypeId", getDefectTypeId())
            .append("problemDescription", getProblemDescription())
            .append("initialAnalysis", getInitialAnalysis())
            .append("dispositionProposal", getDispositionProposal())
            .append("dispositionDetails", getDispositionDetails())
            .append("dispositionApprovedBy", getDispositionApprovedBy())
            .append("dispositionApprovalTime", getDispositionApprovalTime())
            .append("actualDisposition", getActualDisposition())
            .append("ncrStatus", getNcrStatus())
            .append("createdBy", getCreatedBy())
            .append("createdAt", getCreatedAt())
            .append("updatedAt", getUpdatedAt())
            .toString();
    }
}
